<template>
  <div>
    <Modal title="导出" v-model="exportModel" @on-ok="comfirmExport" @on-cancel="backoutExport">
      <div>
        <h3>是否确认导出？</h3>
      </div>
    </Modal>
    <Modal title="撤销" v-model="backoutModal" @on-ok="comfirmbackout" @on-cancel="backoutCancel">
      <div>
        <p>是否确认撤销？</p>
      </div>
    </Modal>
    <Modal title="招投标成功" v-model="successModal" @on-ok="comfirmsuccess" @on-cancel="successCancel">
      <div>
        <p>确定承接该招投标项目？</p>
      </div>
    </Modal>
    <Modal title="放弃" v-model="abandonModal" @on-ok="comfirmabandon" @on-cancel="abandonCancel">
      <div>
        <p>是否确认放弃？</p>
      </div>
    </Modal>
    <div class="swith-btn">
      <Button type="warning" @click="createproject" :disabled="createButton">新建项目</Button>
      <Button type="success" @click="openExportMdel" :disabled="exportListButton">导出清单</Button>
    </div>
    <!-- <br/> -->
    <div class="search-bar">
      <div class="search-block">
        <Row type="flex">
          <Col span="18" order="2">
            <Cascader
            change-on-select
              @on-change="getValue($event)"
              style="width:200px"
              :data="dataTree"
              :render-format="format"
              :disabled="easySearchBton"
            ></Cascader>
          </Col>
          <Col span="6" order="1">承接部门:</Col>
        </Row>
      </div>
      <div class="search-block">
        <Row type="flex">
          <Col span="18" order="2">
            <Select
              ref="myperson"
              v-model="model1"
              style="width:200px"
              @on-change="getperId($event)"
              :label-in-value="true"
              :disabled="easySearchBton"
            >
              <Option v-for="item in personName" :value="item.id" :key="item.id">{{ item.name }}</Option>
            </Select>
          </Col>
          <Col span="6" order="1">承接人员:</Col>
        </Row>
        <!-- <span>承接人员:</span> -->
      </div>
      <div class="search-block1">
        <Row type="flex">
          <Col span="18" order="2">
            <Select
              v-model="model2"
              style="width:100px"
              @on-change="getyear($event)"
              :label-in-value="true"
              :disabled="easySearchBton"
            >
              <Option v-for="item in yearName" :value="item.id" :key="item.id">{{ item.name }}</Option>
            </Select>
          </Col>
          <Col span="6" order="1">年份:</Col>
        </Row>
        <!-- <span>年份:</span> -->
      </div>
      <div class="search-block2">
        <Button type="primary" @click="getNewData" :disabled="easySearchBton">搜索</Button>
      </div>

      <div class="senior-search-block">
        <Button v-if="clearHigh" type="warning" @click="HighClear">清除高级条件</Button>
        <Poptip trigger="focus" content="包含高级查询内容">
          <Input class="search-content" v-model="keyword" :disabled="highWinButton" />
        </Poptip>
        <Button type="default" @click="OpenhihgLevelSearch" :disabled="highWinButton">高级查询</Button>

        <Button type="primary" style @click="hihgLevelSearch" :disabled="highSearchBton">搜索</Button>
      </div>
    </div>
    <div>
      <Table
        height="500"
        stripe
        border
        :columns="columns"
        :data="data"
        @on-selection-change="selectChange"
      ></Table>
    </div>
    <br />
    <div>
      <Page :total="totalDataNo" @on-change="getpageNum" />
    </div>
    <transition name="bidding-create">
      <div class="bidding-block" v-if="newproject">
        <div class="bidding-block-top">
          <div class="bidding-block-close" @click="closebiddingcreate">
            <!--左上角关闭动作-->
            <Icon type="md-close" />
          </div>
          <span>新建招投标</span>
        </div>
        <div>
          <div class="bidding-body">
            <!-- <div class="bidding-title">
              <span>招投标信息</span>
            </div>-->

            <div class="bidding-content">
              <Form ref="formCreate" :model="newinfo" :rules="ruleCreate" :label-width="150">
                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">基本信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="项目名称：" prop="name">
                          <Input class="bidding-item-input" v-model.trim="newinfo.name" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="项目类别：" prop="type">
                          <Select v-model="newinfo.type" style="width:200px" :label-in-value="true">
                            <Option
                              v-for="item in proType"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="newinfo.type"/> -->
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="项目编制人员：" prop="edit_person_id">
                          <!-- <Input class="bidding-item-input" v-model="newinfo.edit_person_id"/> -->
                          <Select
                            v-model="newinfo.edit_person_id"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in editPerList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="完成部门：" prop="finish_department_id">
                          <Select
                            v-model="newinfo.finish_department_id"
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in dptList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="newinfo.finish_department_id"/> -->
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="承接部门：" prop="undertake_department_id">
                          <Input
                            class="bidding-item-input"
                            v-model="newinfo.undertake_department_id"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="承接人员：" prop="undertake_person_id">
                          <Input
                            class="bidding-item-input"
                            v-model="newinfo.undertake_person_id"
                            disabled
                          />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="投标日期：" prop="bid_date">
                          <DatePicker style="width:200px" type="date" v-model="newinfo.bid_date"></DatePicker>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="建设单位：" prop="development_organization">
                          <Input
                            class="bidding-item-input"
                            v-model.trim="newinfo.development_organization"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="投标报价：" prop="bid_price">
                          <Input class="bidding-item-input" v-model.trim="newinfo.bid_price" />
                          <p>万元</p>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="所属地区：" prop="province">
                          <Select
                            v-model="newinfo.province"
                            style="width:182px"
                            @on-change="choseProvince"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in province"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <Select
                            v-model="newinfo.city"
                            style="width:182px"
                            @on-change="choseCity"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in shi1"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <Select
                            v-model="newinfo.area"
                            style="width:182px"
                            @on-change="choseBlock"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in qu1"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="newinfo.province"/> -->
                          <!-- <Input class="bidding-item-input" v-model="newinfo.city"/> -->
                          <!-- <Input class="bidding-item-input" v-model="newinfo.area"/> -->
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">招标代理信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="招标代理单位：" prop="bidding_agency">
                          <Input class="bidding-item-input" v-model.trim="newinfo.bidding_agency" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="代理联系人：" prop="agency_contact">
                          <Input class="bidding-item-input" v-model.trim="newinfo.agency_contact" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="代理联系人电话：" prop="agency_phone">
                          <Input class="bidding-item-input" v-model.trim="newinfo.agency_phone" />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">委托招标平台信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="委托招投标平台：" prop="bid_platform">
                          <Input class="bidding-item-input" v-model.trim="newinfo.bid_platform" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="联系人：" prop="contact">
                          <Input class="bidding-item-input" v-model.trim="newinfo.contact" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="联系方式：" prop="contact_phone">
                          <Input class="bidding-item-input" v-model.trim="newinfo.contact_phone" />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">保证金信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="保证金账户：" prop="promise_cash_account">
                          <Input
                            class="bidding-item-input"
                            v-model.trim="newinfo.promise_cash_account"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="保证金：" prop="promise_cash">
                          <Input class="bidding-item-input" v-model.trim="newinfo.promise_cash" />
                          <p>万元</p>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="保证金单位开户银行：" prop="promise_cash_bank">
                          <Input
                            class="bidding-item-input"
                            v-model.trim="newinfo.promise_cash_bank"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="保证金单位银行账号：" prop="promise_cash_bank_account">
                          <Input
                            class="bidding-item-input"
                            v-model.trim="newinfo.promise_cash_bank_account"
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">其他</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="备注：" prop="remark">
                          <Input
                            v-model.trim="newinfo.remark"
                            type="textarea"
                            style="width: 910px"
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div>
                  <Button type="primary" @click="submitcreate('formCreate')">确定</Button>
                  <Button @click="closebiddingcreate('formCreate')">取消</Button>
                </div>
              </Form>
            </div>
          </div>
        </div>
      </div>
    </transition>
    <transition name="bidding-detail">
      <div class="bidding-block" v-if="biddingDtail">
        <div class="bidding-block-top">
          <div class="bidding-block-close" @click="closebiddingdtail">
            <!--左上角关闭动作-->
            <Icon type="md-close" />
          </div>
          <span>招投标信息</span>
        </div>
        <div>
          <div class="bidding-body">
            <!-- <div class="bidding-title">
              <span>招投标信息</span>
            </div>-->

            <div class="bidding-content">
              <Form :label-width="150">
                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">基本信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <!-- <p>项目名称：</p> -->
                        <FormItem label="项目名称：" prop="name">
                          <Input class="bidding-item-input" v-model="infodetail.name" disabled />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>项目类别：</p> -->
                        <FormItem label="项目类别：" prop="type">
                          <Input class="bidding-item-input" v-model="infodetail.type" disabled />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>项目编制人员：</p> -->
                        <FormItem label="项目编制人员：" prop="edit_person_id">
                          <Select
                            v-model="infodetail.editPersonId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in editPerList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="infodetail.editPersonId" disabled/> -->
                        </FormItem>
                      </div>
                    </div>

                    <div>
                      <div class="bidding-item">
                        <!-- <p>完成部门</p> -->
                        <FormItem label="完成部门：" prop="finish_department_id">
                          <Select
                            v-model="infodetail.finishDepartmentId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in dptList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>承接部门：</p> -->
                        <FormItem label="承接部门：" prop="undertake_department_id">
                          <Select
                            v-model="infodetail.undertakeDepartmentId"
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in dptList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>承接人：</p> -->
                        <FormItem label="承接人员：" prop="undertake_person_id">
                          <Select
                            v-model="infodetail.undertakePersonId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in allPeo"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>

                    <div>
                      <div class="bidding-item">
                        <!-- <p>投标日期</p> -->
                        <FormItem label="投标日期：" prop="bid_date">
                          <Input class="bidding-item-input" v-model="infodetail.bidDate" disabled />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>建设单位：</p> -->
                        <FormItem label="建设单位：" prop="development_organization">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.developmentOrganization"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>投标报价：</p> -->
                        <FormItem label="投标报价：" prop="bid_price">
                          <Input class="bidding-item-input" v-model="infodetail.bidPrice" disabled />
                          <p>万元</p>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <!-- <p>所属地区：</p> -->
                        <FormItem label="所属地区：" prop="province">
                          <Input
                            style="width:182px"
                            class="bidding-item-input"
                            v-model="infodetail.province"
                            disabled
                          />
                          <Input
                            style="width:182px"
                            class="bidding-item-input"
                            v-model="infodetail.city"
                            disabled
                          />
                          <Input
                            style="width:182px"
                            class="bidding-item-input"
                            v-model="infodetail.area"
                            disabled
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">招标代理信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <!-- <p>招标代理单位：</p> -->
                        <FormItem label="招标代理单位：" prop="bidding_agency">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.biddingAgency"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>代理联系人：</p> -->
                        <FormItem label="代理联系人：" prop="agency_contact">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.agencyContact"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>代理联系人电话：</p> -->
                        <FormItem label="代理联系人电话：" prop="agency_phone">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.agencyPhone"
                            disabled
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">委托招标平台信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <!-- <p>委托招投标平台：</p> -->
                        <FormItem label="委托招投标平台：" prop="bid_platform">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.bidPlatform"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>联系人：</p> -->
                        <FormItem label="联系人：" prop="contact">
                          <Input class="bidding-item-input" v-model="infodetail.contact" disabled />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>联系方式：</p> -->
                        <FormItem label="联系方式：" prop="contact_phone">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.contactPhone"
                            disabled
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">保证金信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <!-- <p>保证金账户：</p> -->
                        <FormItem label="保证金账户：" prop="promise_cash_account">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.promiseCashAccount"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>保证金</p> -->
                        <FormItem label="保证金：" prop="promise_cash">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.promiseCash"
                            disabled
                          />
                          <p>万元</p>
                        </FormItem>
                      </div>
                    </div>

                    <div>
                      <div class="bidding-item">
                        <!-- <p>保证金单位开户银行：</p> -->
                        <FormItem label="保证金单位开户银行：" prop="promise_cash_bank">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.promiseCashBank"
                            disabled
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <!-- <p>保证金单位银行账号：</p> -->
                        <FormItem label="保证金单位银行账号：" prop="promise_cash_bank_account">
                          <Input
                            class="bidding-item-input"
                            v-model="infodetail.promiseCashBankAccount"
                            disabled
                          />
                          <!-- <p>万元</p> -->
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <!-- <div></div> -->
                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">其他</h4>
                  </div>
                  <div class="panel-body">
                    <div>
                      <div class="bidding-item">
                        <!-- <p>备注：</p> -->
                        <FormItem label="备注：" prop="remark">
                          <Input
                            disabled
                            v-model.trim="infodetail.remark"
                            type="textarea"
                            style="width: 910px"
                          />
                          <!-- <Input type="areatext" v-model="infodetail.remark" disabled /> -->
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div>
                  <Button type="primary" @click="closebiddingdtail">确定</Button>
                  <!-- <Button @click="closebiddingdtail">取消</Button> -->
                </div>
              </Form>
            </div>
          </div>
        </div>
      </div>
    </transition>

    <transition name="bidding-edit">
      <div class="bidding-block" v-if="biddingDtailedit">
        <div class="bidding-block-top">
          <div class="bidding-block-close" @click="closebiddingedit">
            <!--左上角关闭动作-->
            <Icon type="md-close" />
          </div>
          <span>修改招投标信息</span>
        </div>
        <div>
          <div class="bidding-body">
            <!-- <div class="bidding-title">
              <span>修改招投标信息</span>
            </div>-->

            <div class="bidding-content">
              <Form ref="formEdit" :model="editinfo" :rules="editRule" :label-width="150">
                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">基本信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="项目名称：" prop="name">
                          <Input class="bidding-item-input" v-model="editinfo.name" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="项目类别：" prop="type">
                          <Select
                            v-model="editinfo.type"
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in proType"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="editinfo.type"/> -->
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="项目编制人员：" prop="editPersonId">
                          <!-- <Input class="bidding-item-input" v-model="editinfo.editPersonId"/> -->
                          <Select
                            v-model="editinfo.editPersonId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in editPerList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="完成部门：" prop="finishDepartmentId">
                          <Select
                            v-model="editinfo.finishDepartmentId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in dptList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input
                        class="bidding-item-input"
                        v-model="editinfo.finishDepartmentId"
                        disabled
                          />-->
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="承接部门：" prop="undertakeDepartmentId">
                          <Select
                            v-model="editinfo.undertakeDepartmentId"
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in dptList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input
                        class="bidding-item-input"
                        v-model="editinfo.undertakeDepartmentId"
                        disabled
                          />-->
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="承接人员：" prop="undertakePersonId" disabled>
                          <Select
                            v-model="editinfo.undertakePersonId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                            disabled
                          >
                            <Option
                              v-for="item in allPeo"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                          <!-- <Input
                        class="bidding-item-input"
                        v-model="editinfo.undertakePersonId"
                        disabled
                          />-->
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="投标日期：">
                          <Row>
                            <FormItem prop="bidDate">
                              <DatePicker
                                style="width:200px"
                                :clearable="false"
                                :editable="false"
                                type="date"
                                v-model="editinfo.bidDate"
                              ></DatePicker>
                            </FormItem>
                          </Row>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="建设单位：" prop="developmentOrganization">
                          <Input
                            class="bidding-item-input"
                            v-model="editinfo.developmentOrganization"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="投标报价：" prop="bidPrice">
                          <Input class="bidding-item-input" v-model="editinfo.bidPrice" />
                          <p>万元</p>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="所属地区：" prop="province">
                          <Select
                            v-model="editinfo.province"
                            style="width:182px"
                            @on-change="choseProvince"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in province"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <Select
                            v-model="editinfo.city"
                            style="width:182px"
                            @on-change="choseCity"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in shi1"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <Select
                            v-model="editinfo.area"
                            style="width:182px"
                            @on-change="choseBlock"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in qu1"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="editinfo.province"/> -->
                          <!-- <Input class="bidding-item-input" v-model="editinfo.city"/> -->
                          <!-- <Input class="bidding-item-input" v-model="editinfo.area"/> -->
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">招标代理信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="招标代理单位：" prop="biddingAgency">
                          <Input class="bidding-item-input" v-model="editinfo.biddingAgency" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="代理联系人：" prop="agencyContact">
                          <Input class="bidding-item-input" v-model="editinfo.agencyContact" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="代理联系人电话：" prop="agencyPhone">
                          <Input class="bidding-item-input" v-model="editinfo.agencyPhone" />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">委托招标平台信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="委托招投标平台：" prop="bidPlatform">
                          <Input class="bidding-item-input" v-model="editinfo.bidPlatform" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="联系人：" prop="contact">
                          <Input class="bidding-item-input" v-model="editinfo.contact" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="联系方式：" prop="contactPhone">
                          <Input class="bidding-item-input" v-model="editinfo.contactPhone" />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">保证金信息</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="保证金账户：" prop="promiseCashAccount">
                          <Input class="bidding-item-input" v-model="editinfo.promiseCashAccount" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="保证金：" prop="promiseCash">
                          <Input class="bidding-item-input" v-model="editinfo.promiseCash" />
                          <p>万元</p>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="保证金单位开户银行：" prop="promiseCashBank">
                          <Input class="bidding-item-input" v-model="editinfo.promiseCashBank" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="保证金单位银行账号：" prop="promiseCashBankAccount">
                          <Input
                            class="bidding-item-input"
                            v-model="editinfo.promiseCashBankAccount"
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">其他</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="备注：" prop="remark">
                          <Input
                            v-model.trim="editinfo.remark"
                            type="textarea"
                            style="width: 910px"
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <!-- <div>
                  <div class="bidding-content">
                    <p>备注：</p>
                    <Input type="areatext" v-model="editinfo.remark" />
                  </div>
                </div>-->

                <div>
                  <Button type="primary" @click="submitbiddingedit('formEdit')">确定</Button>
                  <Button @click="closebiddingedit">取消</Button>
                </div>
              </Form>
            </div>
          </div>
        </div>
      </div>
    </transition>

    <transition name="bidding-high">
      <div class="bidding-block" v-if="biddingHigh">
        <Form ref="formHigh" :model="equalConditions" :label-width="150" :rules="ruleHigh">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="cancelAdd">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>高级查询</span>
          </div>
          <div>
            <div class="bidding-body">
              <div class="bidding-content">
                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">范围</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="合同日期范围从：">
                          <DatePicker type="date" v-model="rangeConditions[0].sta" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <DatePicker type="date" v-model="rangeConditions[0].end" />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="收款日期范围从：">
                          <DatePicker type="date" v-model="rangeConditions[1].sta" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <DatePicker type="date" v-model="rangeConditions[1].end" />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="项目登记日期从：">
                          <DatePicker type="date" v-model="rangeConditions[2].sta" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <DatePicker type="date" v-model="rangeConditions[2].end" />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="发票日期范围从：">
                          <DatePicker type="date" v-model="rangeConditions[3].sta" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <DatePicker type="date" v-model="rangeConditions[3].end" />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="盖章日期范围从：">
                          <DatePicker type="date" v-model="rangeConditions[4].sta" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <DatePicker type="date" v-model="rangeConditions[4].end" />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="招投标日期范围从：">
                          <DatePicker type="date" v-model="rangeConditions[5].sta" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <DatePicker type="date" v-model="rangeConditions[5].end" />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="保证金范围从：" prop="promiseCash">
                          <InputNumber
                            style="width:187px"
                            :min="0"
                            v-model="rangeConditions[6].sta"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <span>至</span>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem :label-width="50">
                          <InputNumber
                            style="width:187px"
                            :min="0"
                            v-model="rangeConditions[6].end"
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">类别</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="项目类别：" :label-width="150">
                          <Select
                            v-model="equalConditions.type"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in proType"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="行业类别：" :label-width="150">
                          <Select
                            v-model="equalConditions.industryType"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in carerType"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="合同归属单位：">
                          <Select
                            v-model="equalConditions.contractOrigin"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in contactOrgOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="所属地区：">
                          <Select
                            v-model="equalConditions.province"
                            style="width:200px"
                            @on-change="choseProvince"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in province"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="equalConditions.province"/> -->
                        </FormItem>
                      </div>

                      <div class="bidding-item">
                        <FormItem :label-width="150">
                          <Select
                            v-model="equalConditions.city"
                            style="width:200px"
                            @on-change="choseCity"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in shi1"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="equalConditions.city"/> -->
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem>
                          <Select
                            v-model="equalConditions.area"
                            style="width:200px"
                            @on-change="choseBlock"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in qu1"
                              :value="item.value"
                              :key="item.id"
                            >{{ item.value }}</Option>
                          </Select>
                          <!-- <Input class="bidding-item-input" v-model="equalConditions.area"/> -->
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">状态</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="项目状态：">
                          <Select
                            v-model="spState"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in contactStateOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="归档状态：">
                          <Select
                            v-model="equalConditions.hasArchived"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in backFileOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="收款状态：">
                          <Select
                            v-model="spCollect"
                            style="width:200px"
                            clearable
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in collecOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>

                      <div class="bidding-item">
                        <FormItem label="盖章状态：">
                          <Select
                            v-model="equalConditions.hasUsualSealed"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in sealOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="发票状态：">
                          <Select
                            v-model="spInvoice"
                            style="width:200px"
                            clearable
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in invoiceOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>

                    <div>
                      <div class="bidding-item">
                        <FormItem label="奖金状态：">
                          <Select
                            v-model="spReward"
                            style="width:200px"
                            clearable
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in rewardOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>

                      <div class="bidding-item">
                        <FormItem label="合同有无：">
                          <Select
                            v-model="equalConditions.hasContract"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in ifContactOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="业务开支：">
                          <Select
                            v-model="spOutput"
                            style="width:200px"
                            clearable
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in outputOption"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="panel panel-default bidding-title">
                  <div class="panel-heading">
                    <h4 class="panel-title">其他</h4>
                  </div>
                  <div class="panel-body">
                    <br />
                    <div>
                      <div class="bidding-item">
                        <FormItem label="项目名称：" prop="name">
                          <Input
                            style="width:200px"
                            class="bidding-item-input"
                            v-model="equalConditions.name"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="任务单编号：" prop="taskNumber">
                          <Input class="bidding-item-input" v-model="equalConditions.taskNumber" />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="建设单位：" prop="developmentOrganization">
                          <Input
                            class="bidding-item-input"
                            v-model="equalConditions.developmentOrganization"
                          />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="编制人员：">
                          <Select
                            v-model="equalConditions.editPersonId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in editPerList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="完成部门：">
                          <Select
                            v-model="equalConditions.finishDepartmentId"
                            clearable
                            style="width:200px"
                            :label-in-value="true"
                          >
                            <Option
                              v-for="item in dptList"
                              :value="item.id"
                              :key="item.id"
                            >{{ item.name }}</Option>
                          </Select>
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="招投标代理单位：" prop="biddingAgency">
                          <Input
                            class="bidding-item-input"
                            v-model="equalConditions.biddingAgency"
                          />
                        </FormItem>
                      </div>
                    </div>
                    <div>
                      <div class="bidding-item">
                        <FormItem label="保证金账户：" prop="promiseCashAccount">
                          <Input
                            class="bidding-item-input"
                            v-model="equalConditions.promiseCashAccount"
                          />
                        </FormItem>
                      </div>
                      <div class="bidding-item">
                        <FormItem label="委托招投标平台：" prop="bidPlatform">
                          <Input
                            style="width:200px"
                            class="bidding-item-input"
                            v-model="equalConditions.bidPlatform"
                          />
                        </FormItem>
                      </div>
                    </div>
                  </div>
                </div>

                <div>
                  <Button type="primary" @click="checkAdd('formHigh')">确定</Button>
                  <Button @click="cancelAdd">取消</Button>
                </div>
              </div>
            </div>
          </div>
        </Form>
      </div>
    </transition>
  </div>
</template>

<script>
import axios from "axios";
// import SelectTree from "../../components/treeSelect.vue";
export default {
  // components: {
  //   SelectTree
  // },
  data() {
    //不能为空 必填
    const validateDate = (rule, value, callback) => {
      if (value) {
        callback();
      } else {
        callback(new Error("不能为空"));
      }
    };
    //不含空格 非必填
    const validateSpace = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeSpachs(value);
        if (res === -1) {
          callback(new Error("不能含有空格"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //只能为数字和字母 非必填
    const validateUnNoLet = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNoLetter(value);
        if (res === -1) {
          callback(new Error("输入只能是数字或英文符号"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //电话格式  非必填     高级查询
    const validatePhone = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgePhone(value);
        if (res === -1) {
          callback(new Error("号码填写不正确"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //汉字+字母  非必填   高级查询
    const validateLenCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字和英文"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //数字+汉字+字母  非必填
    const validateLenNoCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNumberInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字、英文或数字符号"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //只能为数字 必填
    const validateNo = (rule, value, callback) => {
      const res = this.common.judgeNo(value);
      if (res === -1) {
        callback(new Error("输入只能是数字"));
      } else {
        callback();
      }
    };

    //只能为数字和字母 必填
    const validateNoLetter = (rule, value, callback) => {
      const res = this.common.judgeNoLetter(value);
      if (res === -1) {
        callback(new Error("输入只能是数字或英文符号"));
      } else {
        callback();
      }
    };
    //判断输入只能为汉字英文  必填
    const validateChLetter = (rule, value, callback) => {
      const res = this.common.judgeInput(value);
      if (res === -1) {
        callback(new Error("输入只能是汉字或英文符号"));
      } else {
        callback();
      }
    };
    //只能为汉字英文或者数字 必填
    const validateChLetterNo = (rule, value, callback) => {
      const res = this.common.judgeNumberInput(value);
      if (res === -1) {
        callback(new Error("输入只能是汉字、英文或数字符号"));
      } else {
        callback();
      }
    };
    return {
      exportModel: false,
      selectModel: null,
      admin: {},
      row: {},
      //起初显示表的第一个界面的页号，一页的size*****************
      pageNum: 1,
      pageSize: 10,
      modelId: 1,

      //权限disabled设定
      createButton: true,
      exportListButton: true,
      easySearchBton: true,
      highWinButton: true,
      highSearchBton: true,

      totalDataNo: null, //总共的数据个数
      //树型select********************************
      isClearable: true, // 可清空
      isAccordion: true, // 可收起
      valueId: 0, // 查询部门ID
      valueId2: 0,
      props: {
        // 配置项（必选）
        value: "id",
        label: "name",
        children: "children"
        // disabled:true
      },
      submitinfo: {
        promise_cash_account: null, //保证金账户****
        undertake_department_id: null, //承接部门***
        promise_cash_bank_account: null, //保证金银行账户****
        edit_person_id: null, //编制人员
        agency_contact: null, //代理联系人
        bidding_agency: null, //招投标代理
        promise_cash_bank: null, //保证金银行***
        type: null, //项目类别***
        bid_platform: null, //招投标平台***
        bid_price: null, //投标价格****
        undertake_person_id: null, //承接人***

        finish_department_id: null, //完成部门
        development_organization: null, //建设单位****
        name: null, //项目名称****
        agency_phone: null, //代理人联系方式
        bid_date: null, //招投标日期***

        contact_phone: null, //联系方式
        remark: null, //备注
        contact: null, //联系人
        promise_cash: null, //保证金***
        province: null, //省*****
        city: null, //市****
        area: null //区*****
      },
      testdate: null,
      newinfo: {
        promise_cash_account: null, //保证金账户****
        undertake_department_id: null, //承接部门***
        promise_cash_bank_account: null, //保证金银行账户****
        edit_person_id: null, //编制人员
        agency_contact: null, //代理联系人
        bidding_agency: null, //招投标代理
        promise_cash_bank: null, //保证金银行***
        type: null, //项目类别***
        bid_platform: null, //招投标平台***
        bid_price: null, //投标价格****
        undertake_person_id: null, //承接人***

        finish_department_id: null, //完成部门
        development_organization: null, //建设单位****
        name: null, //项目名称****
        agency_phone: null, //代理人联系方式111111
        bid_date: null, //招投标日期***

        contact_phone: null, //联系方式11111111
        remark: null, //备注
        contact: null, //联系人
        promise_cash: null, //保证金***
        province: null, //省*****
        city: null, //市****
        area: null //区*****
      },
      finishDPid: null,
      undertakePeoid: null,
      editinfo: {
        promiseCashAccount: "", //保证金账户
        undertakeDepartmentId: "", //承接部门ID
        promiseCashBankAccount: "", //保证金银行账户
        editPersonId: "", //编制人员id
        agencyContact: "", //代理联系人
        biddingAgency: "", //招投标代理
        promiseCashBank: "", //保证金银行
        type: "", //项目类别
        bidPlatform: "", //招投标平台
        bidPrice: "", //投标价格
        undertakePersonId: "", //承接人id----

        finishDepartmentId: "", //完成部门id---
        developmentOrganization: "", //建设单位
        name: "", //项目名称
        agencyPhone: "", //代理人联系方式
        bidDate: "", //招投标日期

        contactPhone: "", //联系方式
        remark: "", //备注
        contact: "", //联系人
        promiseCash: "", //保证金
        province: "", //省
        city: "", //市
        area: "" //区
        //总计23个
      },
      inserteditinfo: {
        promiseCashAccount: "", //保证金账户
        undertakeDepartmentId: "", //承接部门ID
        promiseCashBankAccount: "", //保证金银行账户
        editPersonId: "", //编制人员id
        agencyContact: "", //代理联系人
        biddingAgency: "", //招投标代理
        promiseCashBank: "", //保证金银行
        type: "", //项目类别
        bidPlatform: "", //招投标平台
        bidPrice: "", //投标价格

        developmentOrganization: "", //建设单位
        name: "", //项目名称
        agencyPhone: "", //代理人联系方式
        bidDate: "", //招投标日期

        contactPhone: "", //联系方式
        remark: "", //备注
        contact: "", //联系人
        promiseCash: "", //保证金
        province: "", //省
        city: "", //市
        area: "" //区
        //总计23个
      },
      //第一个界面查看详情里面的v-modal的定义********************************
      infodetail: {},
      ruleHigh: {
        developmentOrganization: [
          //建设单位 数+英+汉
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        biddingAgency: [
          //招标代理单位： 数+英+汉 非必填
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        bidPlatform: [
          //委托招投标平台 数+英+汉
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        name: [
          //项目名称
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        promiseCashAccount: [
          //保证金账户
          { required: false, validator: validateUnNoLet, trigger: "blur" }
        ],
        taskNumber: [
          { required: false, validator: validateSpace, trigger: "blur" }
        ]
      },
      ruleCreate: {
        contact_phone: [
          //联系方式  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        contact: [
          //联系人 英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        agency_phone: [
          //代理联系人电话  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        agency_contact: [
          //代理联系人  英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        bidding_agency: [
          //招标代理单位： 数+英+汉 非必填
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        promise_cash_account: [
          //保证金账户 数+英文
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNoLetter, trigger: "blur" }
        ],
        undertake_department_id: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        promise_cash_bank_account: [
          //保证金单位银行账号 数+英
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNoLetter, trigger: "blur" }
        ],
        promise_cash_bank: [
          //保证金单位开户银行   汉+英
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetter, trigger: "blur" }
        ],
        type: [{ required: true, message: "不能为空", trigger: "blur" }],
        bid_platform: [
          //委托招投标平台 数+英+汉
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        bid_price: [
          { required: true, message: "不能为空", trigger: "blur" },
          {
            type: "number",
            message: "输入的类型为数字",
            transform(value) {
              return Number(value);
            }
          }
        ],
        undertake_person_id: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        development_organization: [
          //建设单位 数+英+汉
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        name: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        bid_date: [
          {
            required: true,
            type: "date",
            message: "不能为空",
            trigger: "change"
          }
        ],
        promise_cash: [
          { required: true, message: "不能为空", trigger: "blur" },
          {
            type: "number",
            message: "输入的类型为数字",
            transform(value) {
              return Number(value);
            }
          }
        ],
        province: [{ required: true, message: "不能为空", trigger: "blur" }]
      },
      editRule: {
        contactPhone: [
          //联系方式  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        contact: [
          //联系人 英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        agencyPhone: [
          //代理联系人电话  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        agencyContact: [
          //代理联系人  英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        biddingAgency: [
          //招标代理单位： 数+英+汉 非必填
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        promiseCashAccount: [
          //保证金账户 数+英文
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNoLetter, trigger: "blur" }
        ],
        undertakeDepartmentId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        promiseCashBankAccount: [
          //保证金单位银行账号 数+英
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNoLetter, trigger: "blur" }
        ],
        promiseCashBank: [
          //保证金单位开户银行   汉+英
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetter, trigger: "blur" }
        ],
        type: [{ required: true, message: "不能为空", trigger: "blur" }],
        bidPlatform: [
          //委托招投标平台 数+英+汉
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        bidPrice: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNo, trigger: "blur" }
        ],
        undertakePersonId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        developmentOrganization: [
          //建设单位 数+英+汉
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        name: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        // bidDate: [
        //   {
        //     required: true,
        //     type: "date",
        //     message: "不能为空",
        //     trigger: "change"
        //   }
        // ],
        promiseCash: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNo, trigger: "blur" }
        ],
        province: [{ required: true, message: "不能为空", trigger: "blur" }]
      },
      //第一个界面的查询*****************
      personName: [{ id: 0, name: "全部" }], //承接人员数组
      model1: 0, //承接人员ID
      dataTree: [], //部门树
      perNo: 0, //在拿人员的时候定义的一共的页数
      yearName: [], //年份数组
      model2: 0, //年份ID
      nowyear: {}, //当前年

      select1: null,
      select2: null,
      select3: null,

      //定义的一些Modal和弹出************************************
      backoutModal: false, //撤销招投标成功
      abandonModal: false, //放弃项目
      biddingDtail: false, //查看详情
      biddingDtailedit: false, //编辑
      successModal: false,
      newproject: false,

      //只是用于打印部门名称和部门ID
      dpment: "",
      dpmentID: {},

      clearHigh: false,

      // flag1: "1",
      // info1: "qwe111",
      // info2: "poi123",

      //表头信息*******************************************
      columns: [
        {
          type: "selection",
          width: 60,
          align: "center",
          fixed: "left"
        },
        {
          title: "序号",
          width: 100,
          key: "id",
          fixed: "left"
        },
        // {
        //   title: "状态",
        //   width: 120,
        //   key: "state"
        // },
        // {
        //   title: "是否废弃",
        //   width: 120,
        //   key: "ifabandon",
        //   fixed: "right",
        //   render: (h, params) => {
        //     let st = params.row.state;
        //     if (st > 127) {
        //       return h("Dropdown", [
        //         h("Button", { props: { type: "error" } }, "废")
        //       ]);
        //     }
        //   }
        // },
        {
          title: "操作",
          fixed: "right",
          key: "number",
          width: 120,
          render: (h, params) => {
            let st = params.row.state;
            let tab = {};
            let flag = 0;
            let detailBton = true;
            let editBton = true;
            let zhaoBton = true;
            let abandonBton = true;
            if (this.jurisdictionNo >= 1) {
              //处理查看详情disabled
              detailBton = false;
            }
            if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
              //处理编辑信息
              editBton = false;
            }
            if (st == 0) {
              tab = "招投标成功";
              flag = 1;
              if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
                //承接权限才可
                zhaoBton = false;
              }
            } else {
              tab = "撤销招投标成功";
              flag = 2;
              if (st >= 7) {
                zhaoBton = true; //已经标书盖章，禁用
              } else {
                if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
                  //未标书盖章，承接权限才可
                  zhaoBton = false;
                }
              }
            }
            if (st >= 63) {
              if (this.jurisdictionNo == 2 || this.jurisdictionNo == 3) {
                abandonBton = false;
              }
            } else {
              if (this.jurisdictionNo >= 1) {
                abandonBton = false;
              }
            }
            if (st > 127) {
              return h("Badge", { props: { text: "废", offset: [13, 0] } }, [
                h(
                  "Dropdown",
                  {
                    on: {
                      "on-click": name => {
                        let rowData = params.row;
                        let id = rowData.id;

                        if (name == "read") {
                          //点击查看详情
                          this.row = id;
                          this.biddingDtail = true;
                          this.showinfo();
                        } else if (name == "backout") {
                          //撤销
                          this.row = id;
                          //this.backoutModal = true;
                          this.judgeTab(flag);
                        } else if (name == "abandon") {
                          //放弃
                          this.abandonModal = true;
                          this.row = id;
                        } else if (name == "edit") {
                          //编辑
                          this.row = id;
                          this.biddingDtailedit = true;
                          this.geteditinfo(); //不同于查看详情的，重新从服务器那数据赋值到editinfo
                        }
                      }
                    },
                    props: { transfer: true }
                  },
                  [
                    h("Button", { props: { type: "primary" } }, "操作>>"),
                    h("DropdownMenu", { slot: "list" }, [
                      h(
                        "DropdownItem",
                        { props: { name: "read", disabled: detailBton } },
                        "查看详情"
                      ),
                      h(
                        "DropdownItem",
                        { props: { name: "edit", disabled: editBton } },
                        "修改编辑信息"
                      ),
                      h(
                        "DropdownItem",
                        { props: { name: "backout", disabled: zhaoBton } },
                        tab
                      ),
                      h(
                        "DropdownItem",
                        { props: { name: "abandon", disabled: abandonBton } },
                        "项目作废"
                      )
                    ])
                  ]
                )
              ]);
            } else {
              return h(
                "Dropdown",
                {
                  on: {
                    "on-click": name => {
                      let rowData = params.row;
                      let id = rowData.id;

                      if (name == "read") {
                        //点击查看详情
                        this.row = id;
                        this.biddingDtail = true;
                        this.showinfo();
                      } else if (name == "backout") {
                        //撤销
                        this.row = id;
                        //this.backoutModal = true;
                        this.judgeTab(flag);
                      } else if (name == "abandon") {
                        //放弃
                        this.abandonModal = true;
                        this.row = id;
                      } else if (name == "edit") {
                        //编辑
                        this.row = id;
                        this.biddingDtailedit = true;
                        this.geteditinfo(); //不同于查看详情的，重新从服务器那数据赋值到editinfo
                      }
                    }
                  },
                  props: { transfer: true }
                },
                [
                  h("Button", { props: { type: "primary" } }, "操作>>"),
                  h("DropdownMenu", { slot: "list" }, [
                    h(
                      "DropdownItem",
                      { props: { name: "read", disabled: detailBton } },
                      "查看详情"
                    ),
                    h(
                      "DropdownItem",
                      { props: { name: "edit", disabled: editBton } },
                      "修改编辑信息"
                    ),
                    h(
                      "DropdownItem",
                      { props: { name: "backout", disabled: zhaoBton } },
                      tab
                    ),
                    h(
                      "DropdownItem",
                      { props: { name: "abandon", disabled: abandonBton } },
                      "项目作废"
                    )
                  ])
                ]
              );
            }
          }
        }
      ],

      //表数据
      data: [],
      userName: null,
      userDepment: null,
      userID: null,
      userDepmentID: null,
      editType: null,
      editDate: null,
      proType: [], //项目类别名单
      //editPeo: [], //项目编制人员名单
      dptList: [], //所有部门列表
      carerType: [], //所有行业类别
      allPeo: [], //所有人的名单
      allPeoPages: null,
      editPerList: [], //编制权限人名单
      ////////////////////////////////////////////////////////////////////////////////////
      biddingHigh: false,

      equalConditions: {
        //单个字段list
        developmentOrganization: null, //建设单位
        //state: null, //项目状态
        hasArchived: null, //归档状态
        editPersonId: null, //编制人id
        finishDepartmentId: null, //完成部门id
        biddingAgency: null, //招投标代理单位
        promiseCashAccount: null, //保证金账户
        bidPlatform: null, //委托招投标平台
        name: null, //项目名称
        taskNumber: null, //任务单编号
        province: null,
        city: null,
        area: null,
        type: null, //项目类别
        industryType: null, //行业类别
        contractOrigin: null, //合同归属单位
        hasUsualSealed: null, //盖章状态
        hasContract: null, //合同有无
        businessFeeTag: null //业务开支有无
        //共19个
      },
      rangeConditions: [
        //传给后端的时间，或金额字段
        {
          field: "contractDate",
          sta: null,
          end: null
        },
        {
          field: "collectionDate",
          sta: null,
          end: null
        },
        {
          field: "registDate",
          sta: null,
          end: null
        },
        {
          field: "invoiceDate",
          sta: null,
          end: null
        },
        {
          field: "usualSealDate",
          sta: null,
          end: null
        },
        {
          field: "bidDate",
          sta: null,
          end: null
        },
        {
          field: "promiseCash",
          sta: null,
          end: null
        }
      ],
      rangeConditionsNew: [
        //传给后端的时间，或金额字段
        {
          field: "contractDate",
          sta: null,
          end: null
        },
        {
          field: "collectionDate",
          sta: null,
          end: null
        },
        {
          field: "registDate",
          sta: null,
          end: null
        },
        {
          field: "invoiceDate",
          sta: null,
          end: null
        },
        {
          field: "usualSealDate",
          sta: null,
          end: null
        },
        {
          field: "bidDate",
          sta: null,
          end: null
        },
        {
          field: "promiseCash",
          sta: null,
          end: null
        }
      ],
      specialConditions: [], //传给后端的特殊字段

      spCollect: null, //特殊收款状态v-model
      spInvoice: null, //特殊发票状态v-model
      spReward: null, //特殊奖金状态v-model
      spOutput: null, //特殊业务开支v-model，0或1直接赋值到list，2添加到特殊
      spState: null, //特殊合同状态v-model

      contactOrgOption: [
        //合同归属
        {
          id: "学校",
          name: "学校"
        },
        {
          id: "公司",
          name: "公司"
        }
      ],
      collecOption: [
        //收款状态
        {
          id: "collectionAmount=0",
          name: "尚无收款"
        },
        {
          id: "collectionAmount=fund",
          name: "已收款"
        },
        {
          id: "collectionAmount>0 and collectionAmount<fund",
          name: "部分收款"
        },
        {
          id: "collectionAmount=0 or collectionAmount<fund",
          name: "尚无收款及部分收款"
        },
        {
          id: "collectionAmount>0",
          name: "已收款及部分收款"
        }
      ],
      sealOption: [
        //盖章状态
        {
          id: 0,
          name: "未盖章"
        },
        {
          id: 1,
          name: "已盖章"
        }
      ],
      invoiceOption: [
        //发票状态
        {
          id: "invoiceAmount=0",
          name: "发票未开"
        },

        {
          id: "invoiceAmount>0 and invoiceAmount<fund",
          name: "发票部分开"
        },
        {
          id: "invoiceAmount>0 and invoiceAmount<=fund",
          name: "发票已开+部分开"
        },
        {
          id: "invoiceAmount=0 or (invoiceAmount > 0 and invoiceAmount<fund)",
          name: "发票未开+部分开"
        },
        {
          id: "invoiceAmount=fund and invoiceAmount!=0",
          name: "发票已开"
        }
      ],
      rewardOption: [
        //奖金状态
        {
          id: "rewardAmount=0",
          name: "尚无奖金"
        },
        {
          id: "rewardAmount=collectionAmount and rewardAmount!=0",
          name: "奖金等于收款"
        },
        {
          id: "rewardAmount>collectionAmount",
          name: "奖金多于收款"
        },
        {
          id: "rewardAmount<collectionAmount",
          name: "奖金少于收款"
        },
        {
          id: "rewardAmount<collectionAmount or rewardAmount=0",
          name: "尚无奖金且奖金少于收款"
        }
      ],
      ifContactOption: [
        //合同有无
        {
          id: 0,
          name: "无合同"
        },
        {
          id: 1,
          name: "有合同"
        }
      ],
      outputOption: [
        //业务开支
        {
          id: 0,
          name: "无"
        },
        {
          id: 1,
          name: "有"
        },
        {
          id: 2,
          name: "未处理"
        }
      ],
      contactStateOption: [
        //项目状态
        {
          id: "(state>>7)&1=0",
          name: "正常"
        },
        {
          id: "(state>>7)&1=1",
          name: "废弃"
        }
      ],
      backFileOption: [
        //归档状态
        {
          id: 1,
          name: "已归档"
        },
        {
          id: 0,
          name: "未归档"
        }
      ],
      jurisdiction: null, //当前用户的权限
      jurisdictionNo: null, //1标识只有承接，2表示只有管理，3表示都有
      selectId: [], //选中的项目数组
      ids: [], //要传的id数组
      keyword: null,
      mapJson: this.IP.IP + "/map.json",
      province: "",
      sheng: "",
      shi: "",
      shi1: [],
      qu: "",
      qu1: [],
      city: "",
      block: "",
      corse1: {
        label: null
      },
      corse2: {
        label: null
      },
      corse3: {
        label: null
      },
      data3: [
        {
          value: "zhejiang",
          label: "浙江",
          children: [
            {
              value: "hangzhou",
              label: "杭州",
              children: [
                {
                  value: "xihu",
                  label: "西湖",
                  code: 310000
                }
              ]
            }
          ]
        },
        {
          value: "jiangsu",
          label: "江苏",
          children: [
            {
              value: "nanjing",
              label: "南京",
              children: [
                {
                  value: "zhonghuamen",
                  label: "中华门",
                  code: 210000
                }
              ]
            }
          ]
        }
      ]
    };
  },

  beforeMount() {
    this.getNewData(); //产生表信息
    this.getcolumns(); //产生表头
    this.getdepartments(); //得到部门的name和ID
    this.getNowYear();
    this.getUsername();
    this.getUserInfo();
    this.getproType(); //项目类别

    this.getCarerType(); //行业类别
    this.getEditpersonList(); //编制人员
    this.getAllPeo(); //得到所有人
    this.getCityData();
    this.getJurisdiction(); //获得当前用户的权限
  },
  methods: {
    format(labels, selectedData) {
      const index = labels.length - 1;
      const data = selectedData[index] || false;
      if (data && data.code) {
        return labels[index];
      }
      return labels[index];
    },
    backoutExport() {
      this.exportModel = false;
      this.openExportMdel = null;
    },
    comfirmExport() {
      this.exportModel = false;
      this.exportList();
    },
    openExportMdel() {
      this.exportModel = true;
      // this.openExportMdel=name;
    },
    getJurisdiction() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getPermission"
      }).then(result => {
        this.jurisdiction = result.data.data;
        var i = 0;
        var judge1 = 0;
        var judge2 = 0;
        for (i; i < this.jurisdiction.length; i++) {
          if (this.jurisdiction[i] == "承接") {
            judge1 = 1;
          }
          if (this.jurisdiction[i] == "管理") {
            judge2 = 1;
          }
        }
        if (judge1 == 1 && judge2 == 1) {
          this.jurisdictionNo = 3;
        } else if (judge1 != 1 && judge2 == 1) {
          this.jurisdictionNo = 2;
        } else if (judge1 == 1 && judge2 != 1) {
          this.jurisdictionNo = 1;
        } else {
          this.jurisdictionNo = -1;
        }
        this.handleJurisdiction();
      });
    },
    //处理操作的disabled
    handleJurisdiction() {
      if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
        this.createButton = false;
      } else {
        this.createButton = true;
      }
      if (this.jurisdictionNo >= 1) {
        this.exportListButton = false;
        this.easySearchBton = false;
        this.highWinButton = false;
        this.highSearchBton = false;
      } else {
        this.exportListButton = true;
        this.easySearchBton = true;
        this.highWinButton = true;
        this.highSearchBton = true;
      }
    },
    // 选省
    choseProvince: function(e) {
      for (var index2 in this.province) {
        if (e.label === this.province[index2].value) {
          this.shi1 = this.province[index2].children;
          this.shi = this.province[index2].children[0].value;
          this.qu1 = this.province[index2].children[0].children;
          this.qu = this.province[index2].children[0].children[0].value;
          this.E = this.qu1[0].id;
        }
      }
    },
    // 选市
    choseCity: function(e) {
      for (var index3 in this.city) {
        if (e.label === this.city[index3].value) {
          this.qu1 = this.city[index3].children;
          this.qu = this.city[index3].children[0].value;
          this.E = this.qu1[0].id;
        }
      }
    },
    // 选区
    choseBlock: function(e) {
      this.E = e.label;
    },
    getCityData: function() {
      var that = this;
      axios
        .get(this.mapJson)
        .then(function(response) {
          if (response.status == 200) {
            var data = response.data;
            that.province = [];
            that.city = [];
            that.block = [];
            // 省市区数据分类
            for (var item in data) {
              if (item.match(/0000$/)) {
                //省
                that.province.push({
                  id: item,
                  value: data[item],
                  children: []
                });
              } else if (item.match(/00$/)) {
                //市
                that.city.push({ id: item, value: data[item], children: [] });
              } else {
                //区
                that.block.push({ id: item, value: data[item] });
              }
            }
            // 分类市级
            for (var index in that.province) {
              for (var index1 in that.city) {
                if (
                  that.province[index].id.slice(0, 2) ===
                  that.city[index1].id.slice(0, 2)
                ) {
                  that.province[index].children.push(that.city[index1]);
                }
              }
            }
            // 分类区级
            for (var item1 in that.city) {
              for (var item2 in that.block) {
                if (
                  that.block[item2].id.slice(0, 4) ===
                  that.city[item1].id.slice(0, 4)
                ) {
                  that.city[item1].children.push(that.block[item2]);
                }
              }
            }
          } else {
            //console.log(response.status);
          }
        })
        .catch(function(error) {
          //console.log(typeof +error);
        });
    },
    insertPeo() {
      var i = 1;
      for (i = 1; i <= this.allPeoPages; i++) {
        axios({
          method: "get",
          url: this.IP.IP + "/personInfo/show?pageNum=" + i + "&pageSize=" + 10
        }).then(result => {
          var total = result.data.data.list.length;
          var list = result.data.data.list;

          for (var j = 0; j < total; j++) {
            this.allPeo.push({
              id: list[j].id + "",
              name: list[j].name + ""
            });
          }
        });
      }
    },
    getAllPeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/show?pageNum=" + 1 + "&pageSize=" + 10
      }).then(result => {
        this.allPeoPages = result.data.data.pages;
        this.insertPeo();
      });
    },
    getEditpersonList() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEditPerson"
      }).then(result => {
        var total = result.data.data.length;
        var list = result.data.data;
        for (var i = 0; i < total; i++) {
          this.editPerList.push({
            id: list[i].personId + "",
            name: list[i].personName + ""
          });
        }
      });
    },
    getCarerType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getIndustryTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.carerType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
      });
    },
    addSpecial() {
      //添加进speciall
      this.specialConditions = [];
      if (this.spState) {
        this.specialConditions.push(this.spState);
      }
      if (this.spCollect) {
        //处理收款
        this.specialConditions.push(this.spCollect);
      }
      if (this.spInvoice) {
        //处理发票
        this.specialConditions.push(this.spInvoice);
      }
      if (this.spReward) {
        //处理奖金
        this.specialConditions.push(this.spReward);
      }
      if (this.spOutput) {
        //处理业务开支
        if (this.spOutput == 2) {
          this.equalConditions.businessFeeTag = null;
          this.specialConditions.push("businessFeeTag is null");
        } else {
          this.equalConditions.businessFeeTag = this.spOutput;
        }
      } else if (this.spOutput == 0) {
        this.equalConditions.businessFeeTag = this.spOutput;
      } else {
        this.equalConditions.businessFeeTag = null;
      }
    },
    setConditionNull() {
      var i = 0;
      if (!this.keyword) {
        this.keyword = null;
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (!this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = null;
        }
        if (!this.rangeConditions[i].end) {
          this.rangeConditions[i].end = null;
        }
      }
      for (i = 0; i < this.rangeConditions.length - 1; i++) {
        if (this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = this.DateToString(
            this.rangeConditions[i].sta
          );
        }
        if (this.rangeConditions[i].end) {
          this.rangeConditions[i].end = this.DateToString(
            this.rangeConditions[i].end
          );
        }
      }
      // this.testdate=this.DateToString(this.rangeConditions[0].sta);
      if (!this.equalConditions.developmentOrganization) {
        //建设单位
        this.equalConditions.developmentOrganization = null;
      }
      // if (!this.equalConditions.state) {
      //   //项目状态
      //   if (this.equalConditions.state != 0) {
      //     this.equalConditions.state = null;
      //   }
      // }
      if (!this.equalConditions.hasArchived) {
        //归档状态
        if (this.equalConditions.hasArchived != 0) {
          this.equalConditions.hasArchived = null;
        }
      }
      if (!this.equalConditions.editPersonId) {
        //编制人id
        this.equalConditions.editPersonId = null;
      }
      if (!this.equalConditions.finishDepartmentId) {
        //完成部门id
        this.equalConditions.finishDepartmentId = null;
      }
      if (!this.equalConditions.biddingAgency) {
        //招投标代理单位
        this.equalConditions.biddingAgency = null;
      }
      if (!this.equalConditions.promiseCashAccount) {
        //保证金账户
        this.equalConditions.promiseCashAccount = null;
      }
      if (!this.equalConditions.bidPlatform) {
        //委托招投标平台
        this.equalConditions.bidPlatform = null;
      }
      if (!this.equalConditions.name) {
        //项目名称
        this.equalConditions.name = null;
      }
      if (!this.equalConditions.taskNumber) {
        //任务单编号
        this.equalConditions.taskNumber = null;
      }
      if (!this.equalConditions.province) {
        //省
        this.equalConditions.province = null;
      }
      if (!this.equalConditions.city) {
        //市
        this.equalConditions.city = null;
      }
      if (!this.equalConditions.area) {
        //区
        this.equalConditions.area = null;
      }
      if (!this.equalConditions.type) {
        //项目类别
        this.equalConditions.type = null;
      }
      if (!this.equalConditions.industryType) {
        //行业类别
        this.equalConditions.industryType = null;
      }
      if (!this.equalConditions.contractOrigin) {
        //合同归属单位
        this.equalConditions.contractOrigin = null;
      }
      if (!this.equalConditions.hasUsualSealed) {
        //盖章状态
        if (this.equalConditions.hasUsualSealed != 0) {
          this.equalConditions.hasUsualSealed = null;
        }
      }
      if (!this.equalConditions.hasContract) {
        //合同有无
        if (this.equalConditions.hasContract != 0) {
          this.equalConditions.hasContract = null;
        }
      }
      if (!this.equalConditions.businessFeeTag) {
        //业务开支有无
        if (this.equalConditions.businessFeeTag != 0) {
          this.equalConditions.businessFeeTag = null;
        }
      }
    },
    ClearCondition() {
      var i = 0;
      this.keyword = null;
      for (i = 0; i < this.rangeConditions.length; i++) {
        this.rangeConditions[i].sta = null;
        this.rangeConditions[i].end = null;
      }
      this.equalConditions.developmentOrganization = null;
      //this.equalConditions.state = null;
      this.equalConditions.hasArchived = null;
      this.equalConditions.editPersonId = null;
      this.equalConditions.finishDepartmentId = null;
      this.equalConditions.biddingAgency = null;
      this.equalConditions.promiseCashAccount = null;
      this.equalConditions.bidPlatform = null;
      this.equalConditions.name = null;
      this.equalConditions.taskNumber = null;
      this.equalConditions.province = null;
      this.equalConditions.city = null;
      this.equalConditions.area = null;
      this.equalConditions.type = null;
      this.equalConditions.industryType = null;
      this.equalConditions.contractOrigin = null;
      this.equalConditions.hasUsualSealed = null;
      this.equalConditions.hasContract = null;
      this.equalConditions.businessFeeTag = null;
      this.specialConditions = [];
      this.spCollect = null;
      this.spInvoice = null;
      this.spReward = null;
      this.spOutput = null;
      this.spState = null;
    },
    HighClear() {
      this.ClearCondition();
      this.clearHigh = false;
    },
    cancelAdd() {
      this.biddingHigh = false;
    },
    checkAdd1() {
      this.setConditionNull(); //空字符串变null
      this.addSpecial();
      this.biddingHigh = false;
      this.clearHigh = true;
    },
    checkAdd(name) {
      //高级查询点确定
      this.$refs[name].validate(valid => {
        if (valid) {
          this.setConditionNull(); //空字符串变null
          this.addSpecial();
          this.biddingHigh = false;
          this.clearHigh = true;
        } else {
          this.$Message.error("格式错误!");
        }
      });
    },
    OpenhihgLevelSearch() {
      this.biddingHigh = true;
    },
    hihgLevelSearch() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
        this.checkAdd1("formHigh");
      }
      this.pageNum = 1;
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 1
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          this.data = result.data.data.data.list;
          var total = result.data.data.data.total;
          this.totalDataNo = total;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    hihgLevelSearch1() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
      }
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 1
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          this.data = result.data.data.data.list;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    getNewData1() {
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      // //console.log(this.select1);
      // //console.log(this.select2);
      // //console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 1
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        //console.info('111');
        ////console.log(fields);
        // var total = response.data.data.data.total;
        // this.totalDataNo = total;
        // console.info("total");
        // //console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getpageNum(e) {
      // console.info("当前页");
      //console.log(e);
      this.pageNum = e;
      if (this.clearHigh) {
        this.hihgLevelSearch1();
      } else {
        this.getNewData1();
      }
    },

    getproType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getProjectTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.proType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("项目类别");
        // ////console.log(this.proType);
      });
    },
    getUserInfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personAndDepartment"
      }).then(result => {
        // console.info("用户信息");
        // //console.log(result);
        this.userName = result.data.data.personName;
        this.userDepment = result.data.data.departmentName;
        this.userID = result.data.data.personId;
        this.userDepmentID = result.data.data.departmentId;
      });
    },
    getUsername() {
      var admin = "";
      admin = this.getCookie("admin");
      // console.info("admin");
      // console.info(admin);
    },
    createproject() {
      this.newproject = true;
      this.newinfo.undertake_department_id = this.userDepment;
      this.newinfo.undertake_person_id = this.userName;
    },
    geteditinfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/bidProject/getTheBidProject?project_id=" + this.row
      }).then(result => {
        ////console.log(this.row);
        //this.infodetail = result.data.data;
        this.editinfo = result.data.data;
        this.editinfo.editPersonId = result.data.data.editPersonId + "";
        this.editinfo.type = result.data.data.typeId + "";
        this.editinfo.undertakeDepartmentId =
          result.data.data.undertakeDepartmentId + "";
        this.editType = this.editinfo.typeId;
        this.editDate = this.editinfo.bidDate;
        this.editinfo.finishDepartmentId =
          result.data.data.finishDepartmentId + "";
        this.editinfo.undertakePersonId =
          result.data.data.undertakePersonId + "";
        this.finishDPid = this.editinfo.finishDepartmentId;
        this.undertakePeoid = this.editinfo.undertakePersonId;
        this.corse1.label = result.data.data.province;
        this.corse2.label = result.data.data.city;
        this.corse3.label = result.data.data.area;
        this.editinfo.bidPrice = result.data.data.bidPrice + "";
        this.editinfo.promiseCash = result.data.data.promiseCash + "";
        if (!result.data.data.contactPhone) {
          this.editinfo.contactPhone = "";
        }
        if (!result.data.data.agencyPhone) {
          this.editinfo.agencyPhone = "";
        }
        // console.info("市");

        this.choseProvince(this.corse1);
        this.choseCity(this.corse2);
        this.choseBlock(this.corse3);
        // console.log("edit", this.editinfo);
        // this.getEandUName();
        // this.getEandUName1();
      });
    },
    // getEandUName(){
    //   axios({
    //     method: "get",
    //     url:
    //       this.IP.IP+"//searchForDepartmentById?departmentId=" +
    //       this.editinfo.finishDepartmentId,
    //   }).then(result => {
    //     this.editinfo.finishDepartmentId=result.data.data.name;
    //     //console.log("完成部门："+this.editinfo.finishDepartmentId);
    //   });

    // },

    submitEditInfo() {
      this.inserteditinfo.promiseCashAccount = this.editinfo.promiseCashAccount;
      this.inserteditinfo.undertakeDepartmentId = this.editinfo.undertakeDepartmentId;
      this.inserteditinfo.promiseCashBankAccount = this.editinfo.promiseCashBankAccount;
      if (this.editinfo.editPersonId != "undefined") {
        this.inserteditinfo.editPersonId = this.editinfo.editPersonId;
      } else {
        this.inserteditinfo.editPersonId = null;
      }
      this.inserteditinfo.agencyContact = this.editinfo.agencyContact;
      this.inserteditinfo.biddingAgency = this.editinfo.biddingAgency;
      this.inserteditinfo.promiseCashBank = this.editinfo.promiseCashBank;
      this.inserteditinfo.type = this.editinfo.type; //
      this.inserteditinfo.bidPlatform = this.editinfo.bidPlatform;
      this.inserteditinfo.bidPrice = Number(this.editinfo.bidPrice);

      this.inserteditinfo.developmentOrganization = this.editinfo.developmentOrganization;
      this.inserteditinfo.name = this.editinfo.name;
      this.inserteditinfo.agencyPhone = this.editinfo.agencyPhone;
      if (this.editinfo.bidDate != this.editDate) {
        this.inserteditinfo.bidDate = this.DateToString(this.editinfo.bidDate);
      } else {
        this.inserteditinfo.bidDate = this.editDate;
      }

      this.inserteditinfo.contactPhone = this.editinfo.contactPhone;
      this.inserteditinfo.remark = this.editinfo.remark;
      this.inserteditinfo.contact = this.editinfo.contact;
      this.inserteditinfo.promiseCash = Number(this.editinfo.promiseCash);
      this.inserteditinfo.province = this.editinfo.province;
      this.inserteditinfo.city = this.editinfo.city;
      this.inserteditinfo.area = this.editinfo.area;
    },
    submitbiddingedit(name) {
      this.$refs[name].validate(valid => {
        if (valid) {
          this.submitEditInfo();
          // console.info("编辑信息");
          // console.log(this.inserteditinfo);

          this.$ajax({
            method: "post",
            url: this.IP.IP + "/bidProject/editBidProject",
            params: {
              projectId: this.row
            },
            data: this.inserteditinfo
          }).then(result => {
            // console.info("确定修改");
            //console.log(result);
            var code = "";
            code = result.data.code;
            var msg = result.data.msg;
            if (code == 0) {
              this.$Message.success("修改成功");
            } else {
              this.$Message.error(msg);
            }
            this.biddingDtailedit = false;
          });
        } else {
          this.$Message.error("未填完整!");
          // console.info("new");
          // console.log(this.newinfo);
        }
      });
    },
    judgeTab(flag) {
      let f = flag;
      //console.info("flag");
      ////console.log(f);
      if (flag == 1) {
        this.successModal = true;
      } else if (flag == 2) {
        this.backoutModal = true;
      }
    },

    getNewData() {
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      //console.log(this.select1);
      //console.log(this.select2);
      //console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: 1,
          pageSize: 10,
          modelId: 1
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        // console.info('111');
        // console.log(this.data);
        var total = response.data.data.data.total;
        this.totalDataNo = total;
        // console.info("total");
        //console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
        //处理
      });
    },

    getdepartments() {
      axios({
        method: "get",
        url: this.IP.IP + "/getDepartments"
      }).then(result => {
        // console.info("部门信息");
        //console.log(result);
        var data = result.data.data;
        this.dataTree = [];
        var i = 0;
        for (i = 0; i < data.length; i++) {
          this.setNode(data[i]);
        }
        this.dataTree = data;
        this.dataTree.unshift({ value: 0, label: "全部", children: [] });
        console.log("tree", this.dataTree);
      });
    },
    setNode(node) {
      if (node != null) {
        node.label = node.nodeDepartmentIndex.name;
        node.value = node.nodeDepartmentIndex.id;
        node.children = node.childrenDepartmentIndexes;
        this.dptList.push({
          id: node.value + "",
          name: node.label
        });
        var i = 0;
        for (i = 0; i < node.childrenDepartmentIndexes.length; i++) {
          this.setNode(node.childrenDepartmentIndexes[i]);
        }
      }
    },

    //找出当前选中的部门的页数
    getpersonPage() {
      axios({
        method: "get",
        url:
          this.IP.IP +
          "/getDepartmentsConsistent?departmentId=" +
          this.valueId +
          "&pageNumber=1&pageSize=5"
      }).then(result => {
        //this.personName = result.data.data.list;
        if (result.data.code == 0) {
          this.perNo = result.data.data.pages;
          // console.info("页数");
          //console.log(this.perNo);
          this.getperson();
        }
      });
    },
    //找到页数后，循环得到人员ID，name
    getperson() {
      var i = 0;
      for (i = 1; i <= this.perNo; i++) {
        axios({
          method: "get",
          url:
            this.IP.IP +
            "/getDepartmentsConsistent?departmentId=" +
            this.valueId +
            "&pageNumber=" +
            i +
            "&pageSize=5"
        }).then(result => {
          var size = result.data.data.size;
          var list = result.data.data.list;
          this.personName = this.personName.concat(list);
        });
      }
      //this.personName.unshift({ id: 0, name: "全部" });
      // console.info("人员名单");
      //console.log(this.personName);
    },

    //点击部门后，若是0则只有全部，不是0的根据ID得到人员的页数
    getValue(e) {
      // this.valueId = e;
      var i = e.length;
      this.valueId = e[i - 1];

      console.log(this.valueId);
      //this.personName = [];
      if (this.valueId != 0) {
        this.personName = [{ id: 0, name: "全部" }];
        this.getpersonPage();
      } else {
        this.model1 = 0;
        this.personName = [{ id: 0, name: "全部" }];
      }
    },
    changeDate(e) {
      // console.info("时间");
      //console.log(e);
      //console.log(this.newinfo.bid_date);
      const d = new Date(e);
      var date = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
      //console.log(date);
      //this.newinfo.bid_date=null;
      this.newinfo.bid_date = date;
    },
    //得到选中人员的ID
    getperId(e) {
      //console.log(e);
      this.valueId2 = e.value;
      // console.info("选中人员ID");
      //console.log(this.valueId2);
      // console.info("部门选择不是全部的MOdal1的值");
      //console.log(this.model1);
    },
    //获取当前年
    getNowYear() {
      var date = new Date();
      var year = date.getFullYear();
      this.nowyear = year;
      // console.info("当前年");
      //console.log(this.nowyear);
      for (var i = 2005; i <= this.nowyear; i++) {
        this.yearName.push({ id: i, name: i + "" });
      }
      this.yearName.unshift({ id: 0, name: "全部" });
      // console.info("年份数组");
      //console.log(this.yearName);
    },
    //点击年份，打印年份ID
    getyear(e) {
      //console.log(this.model2);
    },
    //select获取选择的data全部信息
    selectChange: function(data) {
      //console.log(data);
      this.selectId = data;
    },

    exportList() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      if (this.selectId.length > 0) {
        //选择了select
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        // this.$Spin.show();
        this.realExport();
      } else {
        if (this.clearHigh) {
          //高级查询有条件
          this.$ajax({
            method: "post",
            url: this.IP.IP + "/table/superSearchIds",
            data: {
              equalConditions: this.equalConditions,
              rangeConditions: this.rangeConditions,
              specialConditions: this.specialConditions
            }
          }).then(result => {
            // console.info("2");
            //console.log(result.data.data);
            this.ids = result.data.data;
            // this.$Spin.show();
            this.realExport();
          });
        } else {
          //两个都没有，设定全部导出
          this.$ajax({
            method: "post",
            url: this.IP.IP + "/table/superSearchIds"
          }).then(result => {
            // console.info("3");
            //console.log(result.data.data);
            this.ids = result.data.data;
            // this.$Spin.show();
            this.realExport();
          });
        }
      }
    },
    realExport() {
      axios({
        method: "post",
        url: this.IP.IP + "/bidProject/export",
        data: {
          ids: this.ids
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.$Spin.hide();
          this.downloadFile(result);
        })
        .catch(error => {});
      this.ids = [];
      this.selectId = [];
    },
    downloadFile(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectBidInfo11.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    //第一个界面的查看详情操作
    showinfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/bidProject/getTheBidProject?project_id=" + this.row
      }).then(result => {
        //console.log(this.row);
        this.infodetail = result.data.data;
        //this.editinfo=result.data.data;
        //console.log(this.infodetail);
        this.infodetail.undertakeDepartmentId =
          this.infodetail.undertakeDepartmentId + "";
        this.infodetail.undertakePersonId =
          this.infodetail.undertakePersonId + "";
        this.infodetail.finishDepartmentId =
          this.infodetail.finishDepartmentId + "";
        this.infodetail.editPersonId = this.infodetail.editPersonId + "";
      });
    },

    getcolumns() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var fields = result.data.data.fields;
        var attribute = result.data.data.attribute;
        //var list=result.data.data.data.list;
        var i = 0;
        //console.log(result);
        for (i; i < fields.length; i++) {
          this.columns.push({
            title: fields[i],
            width: 160,
            key: attribute[i]
          });
        }
        //this.data=list;
      });
    },
    getTable() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var list = result.data.data.data.list;
        //var i=0;
        //console.log(result);

        this.data = list;
      });
    },
    getNewTable() {},
    closebiddingdtail() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.biddingDtail = false;
          this.infodetail = {};
        }
      });
    },
    checkCreate() {
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/bidProject/addBidProject",
        params: {},
        data: this.submitinfo
      })
        .then(result => {
          // console.info("确定新建");
          //console.log(result);
          var code = "";
          code = result.data.code;
          var msg = result.data.msg;
          if (code == 0) {
            this.$Message.success("新建招投标项目成功");
            this.resetnewinfo();
            this.getNewData1();
          } else {
            this.$Message.error(msg);
          }
          this.newproject = false;
        })
        .catch(error => {
          this.$Message.success("填写格式不正确");
        });
    },
    inserIntoSubmit() {
      this.submitinfo.promise_cash_account = this.newinfo.promise_cash_account;
      this.submitinfo.undertake_department_id = this.userDepmentID;
      this.submitinfo.promise_cash_bank_account = this.newinfo.promise_cash_bank_account;
      this.submitinfo.edit_person_id = this.newinfo.edit_person_id;
      this.submitinfo.agency_contact = this.newinfo.agency_contact;
      this.submitinfo.bidding_agency = this.newinfo.bidding_agency;
      this.submitinfo.promise_cash_bank = this.newinfo.promise_cash_bank;
      this.submitinfo.type = this.newinfo.type;
      this.submitinfo.bid_platform = this.newinfo.bid_platform;
      this.submitinfo.bid_price = this.newinfo.bid_price;
      this.submitinfo.undertake_person_id = this.userID;
      this.submitinfo.finish_department_id = this.newinfo.finish_department_id;
      this.submitinfo.development_organization = this.newinfo.development_organization;
      this.submitinfo.name = this.newinfo.name;
      this.submitinfo.agency_phone = this.newinfo.agency_phone;
      this.submitinfo.bid_date = this.DateToString(this.newinfo.bid_date);
      this.submitinfo.contact_phone = this.newinfo.contact_phone;
      this.submitinfo.remark = this.newinfo.remark;
      this.submitinfo.contact = this.newinfo.contact;
      this.submitinfo.promise_cash = this.newinfo.promise_cash;
      this.submitinfo.province = this.newinfo.province;
      this.submitinfo.city = this.newinfo.city;
      this.submitinfo.area = this.newinfo.area;
    },
    DateToString(date) {
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      return sDate;
    },
    checkPhone(phone) {
      var strTemp = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
      var isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
      if (strTemp.test(phone) || isPhone.test(phone)) {
        return 1;
      } else {
        return 2;
      }
    },
    submitcreate(name) {
      //明天接口改好了再试
      let that = this;
      var flag = 2;
      var flag1 = 2;
      this.$refs[name].validate(valid => {
        if (valid) {
          // console.log("dianhua1:"+flag);
          if (this.newinfo.agency_phone != null) {
            flag = this.checkPhone(this.newinfo.agency_phone);
            // console.log("dianhua1:"+flag);
          } else {
            flag = 0;
          }
          if (this.newinfo.contact_phone != null) {
            flag1 = this.checkPhone(this.newinfo.contact_phone);
          } else {
            flag1 = 0;
          }
          // console.log("dianhua:"+flag);
          if (1) {
            this.inserIntoSubmit();
            // console.info("信息");
            // console.log(this.submitinfo);
            this.checkCreate();
          } else if (flag == 2 || flag1 == 2) {
            this.$Message.error("电话格式不正确!");
          }
        } else {
          this.$Message.error("未填完整!");
          // console.info("new");
          // console.log(this.newinfo);
        }
      });
    },
    resetnewinfo() {
      this.newinfo.promise_cash_account = null;
      //this.newinfo.undertake_department_id = null;
      this.newinfo.promise_cash_bank_account = null;
      this.newinfo.edit_person_id = null;
      this.newinfo.agency_contact = null;
      this.newinfo.bidding_agency = null;
      this.newinfo.promise_cash_bank = null;
      this.newinfo.type = null;
      this.newinfo.bid_platform = null;
      this.newinfo.bid_price = null;
      //this.newinfo.undertake_person_id = null;

      this.newinfo.finish_department_id = null;
      this.newinfo.development_organization = null;
      this.newinfo.name = null;
      this.newinfo.agency_phone = null;
      this.newinfo.bid_date = null;

      this.newinfo.contact_phone = null;
      this.newinfo.remark = null;
      this.newinfo.contact = null;
      this.newinfo.promise_cash = null;
      this.newinfo.province = null;
      this.newinfo.city = null;
      this.newinfo.area = null;
    },
    closebiddingcreate() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          //this.$refs[name].resetFields();
          that.resetnewinfo();
          that.newproject = false;
          // console.info("new");
          //console.log(that.newinfo);
        }
      });
    },
    closebiddingedit() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.biddingDtailedit = false;
        }
      });
    },
    comfirmbackout() {
      //目前返回的都是-1，不清楚是否能成功
      //console.log(this.row);
      axios({
        method: "get",
        url: this.IP.IP + "/bidProject/undoBid?projectId=" + this.row
      }).then(result => {
        let that = this;
        var code = "";
        code = result.data.code;
        //console.log(result.data.msg);
        if (code == -1) {
          alert(result.data.msg);
        } else {
          alert("已撤销招投标成功！");
        }
        //this.$router.go(0);
      });
      this.getNewData1();
      this.row = {};
    },
    backoutCancel() {
      this.sealMan = "";
    },
    comfirmsuccess() {
      //console.log(this.row);
      axios({
        method: "get",
        url: this.IP.IP + "/bidProject/bid?projectId=" + this.row
      })
        .then(result => {
          let that = this;
          var code = "";
          code = result.data.code;
          //console.log(result.data.msg);
          if (code == 0) {
            alert("招投标成功！");
          } else {
            alert(result.data.msg);
          }
          //this.$router.go(0);
        })
        .catch(error => {
          alert(error);
        });
      this.getNewData1();
      this.row = {};
    },
    successCancel() {
      this.successModal = false;
      this.row = {};
    },
    comfirmabandon() {
      //console.log(this.row);
      axios({
        method: "get",
        url: this.IP.IP + "/undertake/discardProject?projectId=" + this.row
      })
        .then(result => {
          let that = this;
          var code = "";
          code = result.data.code;
          //console.log(result.data.msg);
          if (code == -1) {
            alert(result.data.msg);
          } else {
            alert("废弃成功！");
          }
          this.$router.go(0);
        })
        .catch(error => {
          alert(error);
        });
      this.row = {};
    },
    abandonCancel() {
      this.row = {};
    }
  }
};
</script>

<style>
.top-button-group {
  padding: 5px;
}
.swith-btn {
  padding: 5px;
}
.search-bar {
  width: 100%;
}
.search-block {
  padding: 5px;
  display: inline-block;
  width: 280px;
  height: 50px;
}
.search-block1 {
  padding: 5px;
  display: inline-block;
  width: 180px;
  height: 50px;
}
.search-block2 {
  padding: 5px;
  display: inline-block;
  width: 50px;
  height: 50px;
}
.search-block span {
  line-height: 50px;
}
.search-block .ivu-select {
  width: 150px;
}
.senior-search-block {
  height: 50px;
  padding: 5px;
}
.search-content {
  width: 200px;
}
.bidding-block-enter-active,
.bidding-block-leave-active {
  transition: all 0.3s ease;
}
.bidding-block-enter,
.bidding-block-leave-to {
  transform: scale(0.9);
  opacity: 0;
}
.bidding-block {
  z-index: 1010;
  overflow-y: auto;
  left: 0;
  top: 0;
  position: fixed;
  width: 100%;
  height: 100%;
  background: #efefef;
}
.bidding-body {
  padding: 20px;
}
.bidding-modal {
  z-index: 1051;
}
.bidding-block-top {
  font-size: 15px;
  border-bottom: 1px solid #cdcdcd;
  background: #efefef;
}
.bidding-block-close {
  cursor: pointer;
  display: inline-block;
  border-right: 1px solid #cdcdcd;
  font-size: 20px;
  padding: 0 5px;
}
.bidding-title {
  margin: 10px 5px;
  font-size: 15px;
  padding: 5px;
  color: #000000;
  border-bottom: 1px solid #cdcdcd;
}
.bidding-content {
  padding: 10px 5px;
  border-bottom: 1px dashed #cdcdcd;
}
.bidding-item {
  display: inline-block;
  font-size: 12px;
}
.bidding-item p {
  display: inline-block;
  width: 100px;
}
.bidding-suffix {
  margin-right: 5px;
}
.ivu-input[disabled],
.ivu-input-number-input[disabled] {
  color: #000000;
}
.bidding-item-input {
  width: 200px;
}
.bidding-sum {
  margin-left: 10px;
  font-weight: bold;
  color: #27a9e3;
}
.bidding-list-item {
  margin-bottom: 5px;
}
.demo-spin-icon-load {
  animation: ani-demo-spin 1s linear infinite;
}
</style>